package com.lsh.payment.core.service.payIcp.impl;

import com.lsh.payment.core.dao.payIcp.ChannelInfoMapper;
import com.lsh.payment.core.model.icp.ChannelInfo;
import com.lsh.payment.core.service.payIcp.IChannelInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Project Name: lsh-payment
 * Created by peter on 17/10/26.
 * 北京链商电子商务有限公司
 * Package
 * desc:
 */
@Service
@Transactional(readOnly = true)
public class ChannelInfoServiceImpl implements IChannelInfoService {

    @Autowired
    private ChannelInfoMapper channelInfoMapper;


    @Override
    @Transactional(rollbackFor = Exception.class)
    public int addChannel(ChannelInfo channelInfo) {
        return channelInfoMapper.insertSelective(channelInfo);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateChannel(ChannelInfo channelInfo) {
        return channelInfoMapper.updateByPrimaryKeySelective(channelInfo);
    }

    @Override
    public ChannelInfo selectByTranflow(String tranflow) {
        return channelInfoMapper.selectByPrimaryKey(tranflow);
    }


}
